package cn.icanci.knife4j.controller;

import cn.icanci.knife4j.entry.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: icanci
 * @ProjectName: knife4j-demo
 * @PackageName: cn.icanci.knife4j.controller
 * @Date: Created in 2020/7/1 19:44
 * @ClassAction:
 */
@RestController
public class HelloController {
    @GetMapping(value = "/hello")
    public String hello() {
        return "helli knife4j";
    }

    //只要我们的接口中存在实体类就有
    @GetMapping(value = "/user")
    public User user() {
        return new User("hello", "pwe");
    }

    @ApiOperation("hello2控制器")
    @GetMapping(value = "/hello2")
    public String hello2(@ApiParam("用户名") String username) {
        return "hello" + username;
    }
}
